#ifndef FPLAYER_LOOPER_H
#define FPLAYER_LOOPER_H

#include "MessageQueue.h"

/**
 * author: x-fan
 * date: 2024/1/11
 * desc: 循环取消息体
 */
class Looper {
private:
  MessageQueue *_pMsgQueue = nullptr;
  bool _QuitLoop = false;

public:
  Looper();

  explicit Looper(MessageQueue *pMsgQueue);

  virtual ~Looper() noexcept;

  /**
   * 循环获取MessageQueue的Message
   */
  void loop();

  /**
   * 获取消息队列
   * @return
   */
  MessageQueue *getMessageQueue();

};


#endif //FPLAYER_LOOPER_H
